import request from '@/utils/request'
// 销售订单相关API
export function getSalesOrderList(params) {
  return request({
    url: '/mobile/sales',
    method: 'get',
    params
  })
}

export function createSalesOrder(data) {
  return request({
    url: '/mobile/sales',
    method: 'post',
    data
  })
}

export function updateSalesOrder(id, data) {
  return request({
    url: `/mobile/sales/${id}`,
    method: 'put',
    data
  })
}

export function deleteSalesOrder(id) {
  return request({
    url: `/mobile/sales/${id}`,
    method: 'delete'
  })
}

// 客户相关API
export function getCustomerList(params) {
  return request({
    url: '/mobile/customers',
    method: 'get',
    params
  })
}

export function createCustomer(data) {
  return request({
    url: '/mobile/customers',
    method: 'post',
    data
  })
}

export function updateCustomer(id, data) {
  return request({
    url: `/mobile/customers/${id}`,
    method: 'put',
    data
  })
}

export function deleteCustomer(id) {
  return request({
    url: `/mobile/customers/${id}`,
    method: 'delete'
  })
}